import { IPSControlHandlerAction } from '../ipscontrol-handler-action';
import { IPSAjaxHandler } from './ipsajax-handler';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAjaxHandlerImpl extends PSModelObjectImpl implements IPSAjaxHandler {
  get codeName(): string {
    return this.M.codeName;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get handlerObj(): string {
    return this.M.handlerObj;
  }

  get handlerTag(): string {
    return this.M.handlerTag;
  }

  get handlerTag2(): string {
    return this.M.handlerTag2;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  protected pshandleractions: IPSControlHandlerAction[] | null = null;

  getPSHandlerActions(): IPSControlHandlerAction[] | null {
    if (this.pshandleractions == null) {
      this.pshandleractions = this.fillChildListModel(this.M.getPSHandlerActions, 'control.IPSControlHandlerAction') as IPSControlHandlerAction[];
    }
    return this.pshandleractions;
  }

  get psHandlerActions(): IPSControlHandlerAction[] | null {
    return this.getPSHandlerActions();
  }

  findPSControlHandlerAction(objKey: any): IPSControlHandlerAction | null {
    return this.getPSModel5('control.IPSControlHandlerAction', this.getPSHandlerActions(), objKey) as IPSControlHandlerAction;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get cls(): string {
    return 'PSAjaxHandlerImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.ajax.IPSAjaxHandler') return true;
    return super.instanceof(cls);
  }
}
